package com.day18.BufferStream;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;

public class BufferedStreamDemo02 {
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new java.io.FileReader("myJava\\CopyJava.java"));
        BufferedWriter bw=new BufferedWriter(new java.io.FileWriter("myJava\\CopyJava01.java"));
        for (int i = 0; i < 10; i++) {
            bw.write("hello"+i);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        BufferedReader br1=new BufferedReader(new java.io.FileReader("myJava\\CopyJava01.java"));
        String line;
        while((line=br1.readLine())!=null){
            System.out.println(line);
        }
        br1.close();
    }
}
